package com.tupu.mapper.permission;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tupu.entity.permission.RolePermission;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


public interface RolePermissionMapper extends BaseMapper<RolePermission> {

    @Delete("delete from role_permission where role_id=#{role_id}")
    void deleteByRoleId(Integer role_id);

    @Select("select permission_id from role_permission where role_id = #{roel_id}")
    String findOne(Integer role_id);

    @Update("update role_permission set permission_id = #{permissionIds} WHERE role_id = #{roleId};")
    void updateByRoleId(String permissionIds, Integer roleId);
}
